<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<form:form commandName="model" cssClass="validate" id="changeForm"
	action="change/change/save">
	<input name="id" type="hidden" value="${model.id }">

	<div class="header">
		<h3>变更信息</h3>
	</div>
	<table class="form-table">
		<jsp:include page="step1.jsp"></jsp:include>

		<jsp:include page="changeRelateConciView.jsp"></jsp:include>

	</table> 

	<div class="header">
		<h3>关联流程</h3>
	</div>
	<isperp:processRelation businessKey="${detail.id }" readonly="false"
		processKey="changeProcess" projectIdControl="projectId"></isperp:processRelation>

</form:form>
<script type="text/javascript">
	function resetPriorityName() {
		var $urgencyName = $("#urgencyName option:selected"), urgencyNameCode = parseInt($urgencyName.data("code"));
		var $effectName = $("#effectName option:selected"), effectNameCode = parseInt($effectName.data("code"));

		var ueVal = urgencyNameCode + effectNameCode;

		var $priorityName = $("#priorityName"), $priorityNameOptions = $("#priorityName option");

		for ( var i = 0; i < $priorityNameOptions.length; i++) {
			var $item = $($priorityNameOptions[i]), code = parseInt($item.data("code"));

			if (ueVal >= code) {
				$priorityName.val($item.val());
				$("#priorityName").trigger("chosen:updated");
				return;
			}
		}

	}
</script>

<isperp:buttonList>
	<isperp:processButtons processKey="changeProcess" formId="changeForm"
		processId="${model.processId }" businessKey="${model.id }"></isperp:processButtons>
</isperp:buttonList>



